package org.zfes.snowier.cloud.zbss.cms.router.service.checkFlow;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.cms.checkFlow.model.CmsCheckProcess;
import org.zfes.snowier.cloud.zbss.cms.checkFlow.service.ICmsCheckProcessService;
@Controller 
@RequestMapping("/cms/checkFlow/cmsCheckProcess")
public class CmsCheckProcessController extends BaseController {

	
	@Autowired
	private ICmsCheckProcessService cmsCheckProcessService;
	
	@RequiresPermissions(value="cmsCheckProcess:loadCmsCheckProcessDataSet",desc="审核流程列表")
    @RequestMapping(value="/loadCmsCheckProcessDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsCheckProcessDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsCheckProcessService.loadCmsCheckProcessDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsCheckProcess:createCmsCheckProcess",desc="审核流程添加")
    @RequestMapping(value="/createCmsCheckProcess", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsCheckProcess(CmsCheckProcess cmsCheckProcess){
		cmsCheckProcessService.createCmsCheckProcess(cmsCheckProcess);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsCheckProcess:loadCmsCheckProcess",desc="审核流程加载")
    @RequestMapping(value="/loadCmsCheckProcess", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsCheckProcess(Long id){
		Optional<CmsCheckProcess> ops = cmsCheckProcessService.loadCmsCheckProcessById(id);
		return ajaxQuery("cmsCheckProcess",ops);
    }
	
	@RequiresPermissions(value="cmsCheckProcess:updateCmsCheckProcess",desc="审核流程更新")
    @RequestMapping(value="/updateCmsCheckProcess", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsCheckProcess(CmsCheckProcess cmsCheckProcess){
		cmsCheckProcessService.updateCmsCheckProcess(cmsCheckProcess);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsCheckProcess:deletCmsCheckProcess",desc="审核流程删除")
    @RequestMapping(value="/deleteCmsCheckProcess", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsCheckProcess(Long id){
		cmsCheckProcessService.deleteCmsCheckProcess(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	

}